/**----------------------------------------
 * @description 全局对象管理
 * @author      lxc
 * @file        GlobalMgr.ts
 * @Date        2022-05-05
 * @version     1.0.0
 * ----------------------------------------
 */
import { DataManager } from "./DataManager";
import { DownloadMgr } from "./DownloadMgr";
import { GlobalDefine } from "./GlobalDefine";
import { LocalMsg } from "./message/LocalMsg";
import { MsgMgr, MsgType } from "./message/MsgMgr";
import { ResourceManager } from "./resource/ResourceManager";
import { Tools } from "./tools/Tools";

declare global{
    var gVar : GlobalDefine;
    var LocalMsg : LocalMsg;
}

export class GlobalMgr{
    constructor(){
        window["gVar"] = new GlobalDefine();
        window["LocalMsg"] = new LocalMsg();
        if (!CC_DEBUG){
            gVar.Debug = false;
            gVar.TempDebug = false;
        }
        gVar.UIMsgMgr = new MsgMgr(MsgType.UI);
        gVar.Tools = new Tools();
        gVar.ResMgr = new ResourceManager();
        gVar.DataMgr = new DataManager();
        gVar.Download = new DownloadMgr();
    }
}